import axios from 'axios';


export interface PopularRecord {
  key: number;
  clickNumber: string;
  title: string;
  increases: number;
}
export interface PolicyRecord {
  id: number;
  version: number;
  version_name: string;
  blueprint: string;
  create_time: string;
  cat_id: number;
  cat_second_id: number;
  cat_name: string;
  cat_second_name: string;
}

export interface PolicyParams extends Partial<PolicyRecord> {
  current: number;
  pageSize: number;
  selected: number;
}
export interface Pagination {
  current: number;
  pageSize: number;
  total?: number;
  selected: number;
}

export function contentTypeOptionsCatPlateVersion(data: any) {
  let params = {
    cat_id: null,
    cat_second_id: null,
  };
  if (data.pid == 0) {
    params.cat_id = data.key;
    delete params.cat_second_id;
  } else {
    params.cat_second_id = data.key;
    delete params.cat_id;
  }
  return axios.get<any>('/admin/cat_plate_version/list', {
    params,
  });
}
//查询列表信息
export function queryPlateModuleList(data: any) {
  return axios.get<any>('/admin/cat_plate_module/tree', {
    params: {
      plate_id: data.selected,
    },
  });
}
//添加列表信息
export function addPlateModuleInfo(data: any) {
  return axios.post<any>('/admin/cat_plate_module/add', data);
}

export function deletePlateModule(data: any) {
  return axios.post<any>('/admin/cat_plate_module/del', data);
}
